package com.ytt.core.util.auditing;

import org.springframework.data.auditing.DateTimeProvider;

import java.time.LocalDateTime;
import java.time.temporal.TemporalAccessor;
import java.util.Optional;

/**
 * AuditingDateTimeProvider
 * 提供当前时间，用于auditing
 * @author chenwen
 * @date 2019/9/17 10:22
 */
public class AuditingDateTimeProvider implements DateTimeProvider {

    @Override
    public Optional<TemporalAccessor> getNow() {
        return Optional.of(LocalDateTime.now());
    }
}
